//* boost::bad_any_cast
#include <boost/any.hpp>
#include <iostream>
int main()
{
    try {
        boost::any a = 1;
        std::cout << boost::any_cast<float>(a) << std::endl;
    }
    catch (boost::bad_any_cast &e) { //*derived from std::bad_cast
        std::cerr << e.what() << std::endl;
    }
}